package com.tuanbiao.ui.auth;

import android.content.Context;
import android.content.Intent;

import com.tuanbiao.base.mvp.BasePresenterActivity;
import com.tuanbiao.controllers.AuthController;
import com.tuanbiao.databinding.ActivityAuthSequenceBinding;
import com.tuanbiao.models.AuthModel;
import com.tuanbiao.presenter.SequencePresenter;

public class AuthSequenceActivity extends BasePresenterActivity<SequencePresenter, ActivityAuthSequenceBinding> implements AuthController.SequenceView {

    public static void start(Context context) {
        Intent starter = new Intent(context, AuthSequenceActivity.class);
        context.startActivity(starter);
    }

    @Override
    protected ActivityAuthSequenceBinding getBindingView() {
        return ActivityAuthSequenceBinding.inflate(getLayoutInflater());
    }

    @Override
    protected void initView() {
        binding.ivToolbarBack.setOnClickListener(getBackListener());
        binding.btnConfirm.setOnClickListener(view -> {
            mPresenter.downloadAuthFile(getString(binding.etParentBoxCode));
        });
    }


    @Override
    protected SequencePresenter createPresenter() {
        return new SequencePresenter(new AuthModel(), this);
    }
}